package com.cx.pojo;

import com.cx.service.SendService;

/**
 * @author zhangshuai
 * @version V1.0
 * @Project Java2_26
 * @Package com.cx.pojo
 * @Description:
 * @Date 2025/5/20 8:24
 */
//传统项目：需求分析 项目架构设计 数据库设计  代码实现  测试  部署上线(所有的东西都设计好，按照文档开发)
//敏捷开发: 需求分析 项目架构设计 数据库设计  代码实现  测试  部署上线（仿照去写，先要去搭建框架，完成核心功能，测试上线第一版）
public class MobileCard {
    //移动卡的本身属性
    private String cardNumber;//卡号
    private ServicePackage servicePackage;//套餐
    private double money;//余额
    private double consumeAmount; //消费金额
    private int realTalkTime; //实际通话时长
    private int realSMSCount; //实际短信条数
    private int realFlow; //实际流量

    public MobileCard() {
    }

    public MobileCard(String cardNumber, ServicePackage servicePackage, double money, double consumeAmount, int realTalkTime, int realSMSCount, int realFlow) {
        this.cardNumber = cardNumber;
        this.servicePackage = servicePackage;
        this.money = money;
        this.consumeAmount = consumeAmount;
        this.realTalkTime = realTalkTime;
        this.realSMSCount = realSMSCount;
        this.realFlow = realFlow;
    }

    public MobileCard(String cardNumber, ServicePackage servicePackage, double money) {
        this.cardNumber = cardNumber;
        this.servicePackage = servicePackage;
        this.money = money;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public ServicePackage getServicePackage() {
        return servicePackage;
    }

    public void setServicePackage(ServicePackage servicePackage) {
        this.servicePackage = servicePackage;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public double getConsumeAmount() {
        return consumeAmount;
    }

    public void setConsumeAmount(double consumeAmount) {
        this.consumeAmount = consumeAmount;
    }

    public int getRealTalkTime() {
        return realTalkTime;
    }

    public void setRealTalkTime(int realTalkTime) {
        this.realTalkTime = realTalkTime;
    }

    public int getRealSMSCount() {
        return realSMSCount;
    }

    public void setRealSMSCount(int realSMSCount) {
        this.realSMSCount = realSMSCount;
    }

    public int getRealFlow() {
        return realFlow;
    }

    public void setRealFlow(int realFlow) {
        this.realFlow = realFlow;
    }
    //展示所有信息
    public void show(){

        System.out.println("卡号："+cardNumber+"" +

                "\t余额："+money+"" +
                "\t消费金额："+consumeAmount+"" +
                "\t实际通话时长："+realTalkTime+"" +
                "\t实际短信条数："+realSMSCount+"" +
                "\t实际流量："+realFlow);

        System.out.println(servicePackage.toString());
    }


    public void send(int count) {
        if(servicePackage instanceof SupperPackage){
            //发送短信
            SendService sendService = (SendService) servicePackage;
            sendService.send(count,this);

        }
    }
}